//
//  YbxqCell.swift
//  Auscultation
//
//  Created by 来 on 2020/12/9.
//

import UIKit

class YbxqCell: UICollectionViewCell {
    
    var back_view: UIView!
    
    var tzzx: UILabel!
    var tw: UILabel!
    var phcd: UILabel!
    
    override init(frame: CGRect) {
        super.init(frame: frame)

        back_view = UIView.init()
        back_view.backgroundColor = UIColor.white
        back_view.clipsToBounds = true
        back_view.layer.cornerRadius = 4
        back_view.layer.borderColor = UIColor.init(lgf_HexString: "E1E4E7")?.cgColor
        back_view.layer.borderWidth = 0.5
        addSubview(back_view)
        back_view.snp.makeConstraints { (make) in
            make.top.equalTo(0)
            make.left.equalTo(0)
            make.right.equalTo(0)
            make.bottom.equalTo(-15)
        }
        
        tzzx = UILabel.init()
        tzzx.text = "停诊中心-001"
        tzzx.lgf_AddShowAllText()
        tzzx.font = UIFont.systemFont(ofSize: 14)
        tzzx.textColor = UIColor.init(lgf_HexString: "222222")
        back_view.addSubview(tzzx)
        tzzx.snp.makeConstraints { (make) in
            make.top.equalTo(25)
            make.centerX.equalToSuperview()
            make.width.lessThanOrEqualToSuperview().multipliedBy(0.8)
        }
        
        let line = UIView.init()
        line.backgroundColor = UIColor.init(lgf_HexString: "8D969D")
        back_view.addSubview(line)
        line.snp.makeConstraints { (make) in
            make.top.equalTo(tzzx.snp.bottom).offset(18)
            make.centerX.equalToSuperview()
            make.width.equalTo(1)
            make.height.equalTo(10)
        }
        
        tw = UILabel.init()
        tw.lgf_AddShowAllText()
        tw.text = ""
        tw.font = UIFont.systemFont(ofSize: 14)
        tw.textAlignment = .center
        tw.textColor = UIColor.init(lgf_HexString: "8D969D")
        back_view.addSubview(tw)
        tw.snp.makeConstraints { (make) in
            make.centerY.equalTo(line)
            make.right.equalTo(line.snp.left).offset(-3)
            make.width.equalToSuperview().multipliedBy(0.4)
        }
        
        phcd = UILabel.init()
        phcd.lgf_AddShowAllText()
        phcd.text = ""
        phcd.textAlignment = .center
        phcd.font = UIFont.systemFont(ofSize: 14)
        phcd.textColor = UIColor.init(lgf_HexString: "8D969D")
        back_view.addSubview(phcd)
        phcd.snp.makeConstraints { (make) in
            make.centerY.equalTo(line)
            make.left.equalTo(line.snp.right).offset(3)
            make.width.equalToSuperview().multipliedBy(0.4)
        }
        
    }
    
    func indexPath(_ indexPath: IndexPath) {
        back_view.snp.updateConstraints { (make) in
            make.left.equalTo(indexPath.item % 2 == 0 ? 15 : 7.5)
            make.right.equalTo(indexPath.item % 2 == 0 ? -7.5 : -15)
        }
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
}


